<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <style>
    body {
      width: 100%;
      height: 100vh;
      margin: 0;
      padding: 15px;
      font-family: Arial, sans-serif;
      box-sizing: border-box;
    }
    
    .terminal-item {
      border: 1px solid #ddd;
      margin: 10px 0;
      padding: 10px;
      border-radius: 5px;
    }
    
    .command-input {
      width: 100%;
      padding: 5px;
      margin: 5px 0;
      box-sizing: border-box;
    }
    
    .send-btn {
      background: #4CAF50;
      color: white;
      padding: 5px 10px;
      border: none;
      border-radius: 3px;
      cursor: pointer;
    }
    
    .output-area {
      background: #f5f5f5;
      padding: 10px;
      margin: 10px 0;
      border-radius: 3px;
      max-height: 200px;
      overflow-y: auto;
      font-family: monospace;
      font-size: 12px;
    }
    
    .status {
      padding: 5px;
      margin: 5px 0;
      border-radius: 3px;
    }
    
    .status.success { background: #d4edda; }
    .status.error { background: #f8d7da; }
    
    .auto-commands {
      margin-top: 10px;
    }
    
    .auto-command-btn {
      background: #007bff;
      color: white;
      padding: 3px 8px;
      border: none;
      border-radius: 3px;
      margin: 2px;
      cursor: pointer;
      font-size: 12px;
    }
  </style>
</head>
<body>
  <h3>XTerm 控制器</h3>
  
  <div id="status" class="status">正在检测终端...</div>
  <button id="refresh-btn" class="send-btn" style="margin: 5px 0;">刷新检测</button>
  
  <div id="terminals-container">
    <!-- 终端列表将在这里动态生成 -->
  </div>
  
  <div class="auto-commands">
    <h4>快速命令</h4>
    <button class="auto-command-btn" data-command="ls -la">列出文件</button>
    <button class="auto-command-btn" data-command="pwd">当前目录</button>
    <button class="auto-command-btn" data-command="whoami">当前用户</button>
    <button class="auto-command-btn" data-command="ps aux">进程列表</button>
  </div>
  
  <div id="analysis-output" class="output-area" style="display: none;">
    <h4>输出分析</h4>
    <div id="analysis-content"></div>
  </div>

  <script src="sidepanel.js"></script>
</body>
</html>